<?php
include_once ("CLASS_sesion.php");
include_once ("CLASS_util.php");
include_once ("CLASS_bd_engine.php");

global $BD;
global $cUTIL;

// echo json_encode ($_POST['name']);

global $MotorBD;
$email = trim ( strtolower ( ($_POST ['name']) ) );
// $email = 'admin';
$email = mysql_real_escape_string ( $email );

// Construimos la query
$q = "SELECT email FROM " . TABLA_USUARIOS . " WHERE user = '" . $email . "' LIMIT 1;";

// Ejecutamos la query y obtenemos el número de filas en $n

$r = $MotorBD->QueryBDi_Execute ( $BD->getConexion (), $q );
$n = $MotorBD->QueryBDi_Filas ( $BD->getConexion () );
$row = $MotorBD->mysql_query_fetch_1_ROW_ASSOC ( $r, $n );
$count = $MotorBD->QueryBDi_Filas ( $BD->getConexion () );

echo json_encode ( $row );

?>
